package 寒假刷题;

import java.util.Arrays;
import java.util.OptionalInt;

public class 最小差值1 {

    public int smallestRangeI(int[] nums, int k) {
        int max = Arrays.stream(nums).max().getAsInt();
        int min = Arrays.stream(nums).min().getAsInt();
        return Math.min(0,max-min-2*k);
    }
}
